<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>登录</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">  
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
	<link href="css/main.css" rel="stylesheet" type="text/css" />
	<style type="text/css">
	 body { background: url(images/backgrounds/bodyBg.png) repeat-y 0 0; } 
	</style>
	<script type="text/javascript" src="js/jquery.min.js"></script> 
	<script type="text/javascript" src="js/jquery-ui.min.js"></script>
	<!-- 新增js  -->
	<!-- 
	<script src="Highcharts/js/highcharts.js"></script>
	<script src="Highcharts/js/modules/exporting.js"></script>	
	-->  
  </head>
  <body  class="nobg loginPage" >

<!-- Top fixed navigation -->
<div class="topNav" style="display:none;">
    <div class="wrapper">
        <div class="userNav">
            <ul>
                <li><a href="#" title=""><img src="images/icons/topnav/mainWebsite.png" alt="" /><span>Main website</span></a></li>
                <li><a href="#" title=""><img src="images/icons/topnav/profile.png" alt="" /><span>Contact admin</span></a></li>
                <li><a href="#" title=""><img src="images/icons/topnav/messages.png" alt="" /><span>Support</span></a></li>
                <li><a href="login.html" title=""><img src="images/icons/topnav/settings.png" alt="" /><span>Settings</span></a></li>
            </ul>
        </div>
        <div class="clear"></div>
    </div>
</div>


<!-- Main content wrapper -->
<div class="loginWrapper" >
    <div><img src="images/backgrounds/logintitle.png" alt="" /></div>
    <div class="widget">
        <div class="title"><img src="images/icons/dark/files.png" alt="" class="titleIcon" /><h6>登录</h6></div>
        
            <fieldset>
            <form  id="validate" class="form">
                <div class="formRow">
                    <label for="login">用户名:</label>
                    <div class="loginInput"><input type="text" name="login" class="validate[required]" id="login" /></div>
                    <div class="clear" id="loginname"></div>
                </div>
                
                <div class="formRow">
                    <label for="pass">密码:</label>
                    <div class="loginInput"><input type="password" name="password" class="validate[required]" id="pass" /></div>
                    <div class="clear"></div>
                </div>
               
                <div class="loginControl">
<!--                     <div class="rememberMe"><input type="checkbox" id="remMe" name="remMe" /><label for="remMe">Remember me</label></div> -->
                    <input type="button"  value="登录" class="dredB logMeIn" onclick="userlogin()" />
                    <div class="clear"></div>
                </div>
                </form> 
            </fieldset>
        
    </div>
</div>    

<!-- Footer line -->
<div id="footer">
    <div class="wrapper">As usually all rights reserved</div>
</div>
<script type="text/javascript">
function userlogin(){

	var username = $("#login").val();
	var password = $("#pass").val();
	
	if(username==''){
		alert('用户名不能为空！');
		return;
	}
	$.ajax({
		url: 'loginForm/userLogin',
		type: 'POST',
		data: 'username='+username+'&password='+password,
		dataType: 'text',
		success: function (data) {
			if(data==1){
				window.location.href="<%=basePath%>myIndex.jsp";
			}else{
				alert('用户名或密码无效，请重试！');
				return;
			}
			
		}
	});
	
}


</script>

</body>
</html>
